A typical example of image processing using a plurality of images in which the illumination environment is different is a white balance process using two images, namely, a flash emission image and a non-flash emission image, for the purpose of improving color reproducibility of images by emitting a flash. In general, since flash light and ambient light differ in color temperature, when taking a using a flash, the color balance of illumination differs between a place at which the flash is emitted and other places. For this reason, the color balance of light that hits a subject changes for each area. In a gain process for performing uniform white balance on a screen as in the related art, there is a case in which breakdown occurs. With regard to this, attempts in which flash components of illumination and ambient light components are separated from two images, namely, a flash emission image and a non-flash emission image, and a white-balance gain is adjusted for each pixel, have been made (see, for example, PTL 1).